package com.ruitu.mall_98.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.beanu.arad.base.my_base.base_list.ListBaseAdapter;
import com.beanu.arad.base.my_base.base_list.SuperViewHolder;
import com.beanu.arad.utils.ScreenUtils;
import com.beanu.arad.utils.SizeUtils;
import com.ruitu.mall_98.R;

/**
 * Created by Administrator on 2018/3/27.
 */
public class ProductAdapter extends ListBaseAdapter {
    public ProductAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.app_item_home_model_pro;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        ImageView icon = holder.getView(R.id.icon);//商品图片

        int width = ScreenUtils.getScreenWidth();
        int itemWidth = (width - (SizeUtils.dp2px(20))) / 2;

        RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) icon.getLayoutParams();
        params.width = itemWidth;
        params.height = itemWidth;
        icon.setLayoutParams(params);

//        icon.setImageResource(R.drawable.tmp_app_model_pic);
    }
}

